package com.hub.netty.client.controller;


import com.hub.netty.base.domain.Message;
import com.hub.netty.client.config.NettyClientBoot;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ author 令狐冲
 * @ date & time 2025/2/6 15:32
 */
@RestController
@RequiredArgsConstructor
public class SendMsgController {

    private final NettyClientBoot nettyClientBoot;

    @PostMapping("/sendMsg")
    public String sendMsg(@RequestBody Message message) throws InterruptedException {
        nettyClientBoot.sendMsg(message);
        return "发送成功";
    }

}
